<?php
namespace app\admin\controller;

use app\common\controller\Common;
use app\common\model\User as UserModel;
use think\Loader;
use think\Request;
use think\captcha\Captcha;

class User extends Common
{
    
    public function index()
    {
    	$this->assign('user',UserModel::all());
   		return $this->fetch();
    }

    public function changepass()
    {

    	var_dump(input(''));
    	return $this->fetch();
    }

    public function status()
    {
    	$data = input('post.');

    	// $this->error("你没有权限,请联系超级管理员开通");
    	// 
    	$user = UserModel::get($data['uid']);

    	if($data['status']=='true'){
    		$user->status = 0;
    		$user->save();
    	}else{
    		$user->status = 1;
    		$user->save();
    	}

    	$this->success('变更成功');
    }

}